import React, { Component } from 'react';
import { Modal, Button, Form, Input, Spin } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
import {connect} from 'react-redux'

// 导入自定义组件
import MasterUpdateTaskForm from './masterUpdateTaskForm';
// 导入自定义操作
import { ChangeUserinfoActivate } from '../../../../redux/actions/userinfo'
import { ChangeMasterTasksDataActivate } from '../../../../redux/actions/taskMasterManagePage';


// 用户登录弹窗代码
class MasterUpdateTask extends Component {

    onClose = () => {
        this.props.ChangeMasterTasksDataActivate({activate: false})
        window.location.reload()
    }

  render() {
    const { userinfoState, UpdateTaskMMPState } = this.props
    return (
      <div>
          <Modal
            // mask={true} // 遮盖层
            maskClosable={false} // 点击空白处不关闭
            // maskStyle = '#ff0000'
            visible={UpdateTaskMMPState.activate}
            title="修改任务"
            onCancel={this.onClose}
            footer={[]}
          >
            <MasterUpdateTaskForm />
          </Modal>
      </div>
    );
  }
}

export default connect(
  state => ({
    userinfoState: state.UserInfoReducer.userinfo,
    UpdateTaskMMPState: state.TaskMasterManagePageReducer.updateTask,
  }),
  {
    ChangeUserinfoActivate,
    ChangeMasterTasksDataActivate,
  }
)(MasterUpdateTask)
